package com.hnkywl.sts.entity.jhgl;

import com.hnkywl.sts.entity.base.Sjzdz;
import com.hnkywl.sts.entity.organ.Lj;
import com.hnkywl.sts.entity.organ.Nbgs;
import com.hnkywl.sts.entity.organ.Qyjg;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.util.List;

/**
 * 自购物资计划
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-4-2
 * Time: 下午3:07
 * To change this template use File | Settings | File Templates.
 */
@Entity
@DiscriminatorValue("Zgwzjh")
public class Zgwzjh extends Cgwzjh {
    // 客户
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "KH_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Qyjg kh;
    // 担保方
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "DBF_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Qyjg dbf;
    // 自购物资计划明细
    @OneToMany(fetch = FetchType.LAZY, targetEntity = Zgwzjhmx.class, mappedBy = "zgwzjh")
    @NotFound(action = NotFoundAction.IGNORE)
    private List<Zgwzjhmx> zgwzjhmxList;
    //	自购资金计划
    @OneToOne(fetch = FetchType.LAZY, mappedBy = "zgwzjh", targetEntity = Zgzjjh.class)
    @NotFound(action = NotFoundAction.IGNORE)
    private Zgzjjh zgzjjh;
    //利润比例
    private Double lrbl;
    //融资类型
    @NotFound(action = NotFoundAction.IGNORE)
    private Xy.RZLX rzlx;
    //总部采购
    private Boolean zbcg=false;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CGGS_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Nbgs cggs;


    public Qyjg getKh() {
        return kh;
    }

    public void setKh(Qyjg kh) {
        this.kh = kh;
    }

    public Qyjg getDbf() {
        return dbf;
    }

    public void setDbf(Qyjg dbf) {
        this.dbf = dbf;
    }

    public List<Zgwzjhmx> getZgwzjhmxList() {
        return zgwzjhmxList;
    }

    public void setZgwzjhmxList(List<Zgwzjhmx> zgwzjhmxList) {
        this.zgwzjhmxList = zgwzjhmxList;
    }

    public Zgzjjh getZgzjjh() {
        return zgzjjh;
    }

    public void setZgzjjh(Zgzjjh zgzjjh) {
        this.zgzjjh = zgzjjh;
    }

    public Double getLrbl() {
        return lrbl;
    }

    public void setLrbl(Double lrbl) {
        this.lrbl = lrbl;
    }

    public Xy.RZLX getRzlx() {
        return rzlx;
    }

    public void setRzlx(Xy.RZLX rzlx) {
        this.rzlx = rzlx;
    }

    public Boolean getZbcg() {
        return zbcg;
    }

    public void setZbcg(Boolean zbcg) {
        this.zbcg = zbcg;
    }

    public Nbgs getCggs() {
        return cggs;
    }

    public void setCggs(Nbgs cggs) {
        this.cggs = cggs;
    }
}
